package com.liao.badminton.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.liao.badminton.code.PageParam;
import com.liao.badminton.entity.JoinGroupApply;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author liaocheng
 * @date 2024-12-02
 * description:入群申请表
 */
@Mapper
public interface JoinGroupApplyMapper extends BaseMapper<JoinGroupApply> {
    int updateBy(JoinGroupApply joinGroupApply);

    int add(JoinGroupApply joinGroupApply);

    List<JoinGroupApply> findByPageParam(PageParam<JoinGroupApply> joinGroupApplyPageParam);

    int countByPageParam(PageParam<JoinGroupApply> joinGroupApplyPageParam);

    int deletes(@Param("ids") List<Long> ids);

    List<JoinGroupApply> findByIds(@Param("ids") List<Long> ids);

    void addBatch(List<JoinGroupApply> list);

    JoinGroupApply findById(@Param("id") Long id);

    List<JoinGroupApply> findByParam(@Param("param") JoinGroupApply param);

    @MapKey("group_id")
    Map<Long, Map<String, Integer>> findGroupJoinNum(@Param("groupIds") List<Long> collect);
}
